﻿
/**
* 命名空间: Game.TDBehaviorTree
*
* 功 能： Log节点
* 类 名： NodeLog
*
* Ver 变更日期 负责人 变更内容
* ───────────────────────────────────
* V0.01 2019/12/11 18:56:10  
*/




using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;

namespace  Game.TDBehaviorTree
{
   
   [System.Serializable]
    public class NodeLog : NodeAction
    {
        [JsonProperty("log")]
        public string m_Log;

        public NodeLog() : base(NodeType.Action)
        {
            
        }

        public override NodeResultType Execute()
        {
            UnityEngine.Debug.Log("Log:" + m_Log);
            return NodeResultType.Success;
        }

         public override void Draw(Rect m_Rect,GUIStyle style, NodeValue _value)
        {
            base.Draw(m_Rect, style, _value);
            GUILayout.Label("Log语句");
            m_Log =EditorGUILayout.TextField(m_Log, GUILayout.Width(100), UnityEngine.GUILayout.Height(20));
            _value.m_NodeArgs[0] = m_Log;
        }

        public override void DeRializable(NodeValue _value)
        {
            base.DeRializable(_value);
            m_Log = _value.m_NodeArgs[0];
        }

    }
}
